<?php

if (!$usr->checkPermission('mod_dates_tables','u'))
{
    print "<b>Sie haben nicht die entsprechenden Rechte, um die Tabellen einzurichten!</b>";
    exit;
}

if ($env->param('createTables')){
 if ($env->param('dates')){
   print "Erzeuge Termine<br>";
   $udba->query("Drop table ".$tableforwarder."_dates;");
   $udba->query("create table ".$tableforwarder."_dates (id int unsigned not NULL auto_increment,instance varchar(40) not null,status varchar(1), date bigint unsigned, headline varchar(150), text TEXT, link varchar(255), primary key(id), index(instance));");
 }
} else {
?>
<?php echo $udba->getError() ?>
<form action="<?=$scriptname?>" method="GET">
                <input type="hidden" name="module" value="<?=$module?>">
                <input type="hidden" name="instance" value="<?=$instance?>">
                <input type="hidden" name="target" value="createTables.php">
                <input type="hidden" name="createTables" value="true">
		<input type="checkbox" value="on" name="dates">Termine<br>
		<input type="submit" class="button" value="einrichten">
</form>
<?php
}
?>
